package consumer.hystrix.controller;

import consumer.hystrix.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * Create by Vic Xu on 2019/1/28
 */
@RestController
public class DcController {

    @Autowired
    private ConsumerService consumerService;

    @GetMapping("/consumer")
    public String dc() throws InterruptedException {
        Thread.sleep(5000L);
        String services = "Services: " + consumerService.consumer();
        System.out.println(services);
        return services;
    }
}
